package com.soen341.model;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

//--------------------------------------------------------------------------------------------------------------------------------
/**
* Model class for CourseSequence
*/
//--------------------------------------------------------------------------------------------------------------------------------
@Entity
@Table(name = "coursesequence")
@NamedQueries(
		{
			@NamedQuery(name = "getSequenceById",
						query = "SELECT s FROM CourseSequence s where s.sequenceId=:sequenceId")			
		})
public class CourseSequence implements Serializable
{
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="sequenceId")
	private String sequenceId;

	@Column(name="description")
	private String description;

	@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER)
	@JoinColumn(name="sequenceId")
	private Set<CourseSet> courseSet;
	
	// --------------------------------------------------------------------------------------------------------------------------------
	/**
	 * 	Constructor.
	 */
	// --------------------------------------------------------------------------------------------------------------------------------
	public CourseSequence()
	{
	}


	// --------------------------------------------------------------------------------------------------------------------------------
	/**
	 * Setters and getters.
	 */
	// --------------------------------------------------------------------------------------------------------------------------------

	public String getSequenceId()
	{
		return sequenceId;
	}
	// --------------------------------------------------------------------------------------------------------------------------------
	public void setSequenceId(String id)
	{
		this.sequenceId = id;
	}


	// --------------------------------------------------------------------------------------------------------------------------------
	public String getDescription()
	{
		return description;
	}
	// --------------------------------------------------------------------------------------------------------------------------------
	public void setDescription(String sequenceDescription)
	{
		this.description = sequenceDescription;
	}


	public Set<CourseSet> getCourseSet() {
		return courseSet;
	}


	public void setCourseSet(Set<CourseSet> courseSet) {
		this.courseSet = courseSet;
	}
	
}